﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucRegister.ascx.cs" Inherits="en_ucControl_ucRegister" %>
<%@ Register Assembly="MSCaptcha" Namespace="MSCaptcha" TagPrefix="cc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<script language="javascript" type="text/javascript">
    function UpdateParentsLogin() {
        tb_remove();
        window.parent.location = "Default.aspx";
    }
</script>

<script type="text/javascript">
    function ValidateChecked(sender, args) {
        if ($('#<%= chkAccept.ClientID %>').attr('checked')) {
            $('#tdCheckboxAgree').removeClass("checkReq");
        }
        else {
            $('#tdCheckboxAgree').removeClass("checkReq");
            $('#tdCheckboxAgree').addClass("checkReq");
            args.IsValid = false;
        }
    }    
</script>

<style type="text/css">
    .checkReq
    {
        border: solid 1px black;
        background-color: #2187D9;
    }
</style>
<asp:UpdatePanel ID="updatePnlReg" runat="server">
    <ContentTemplate>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td align="center" style="padding-bottom: 5px; padding-top: 5px">
                    <asp:Label ID="lblMessage" runat="server" Text="">
                    </asp:Label>
                </td>
            </tr>
        </table>
        <asp:Panel ID="pnlRegister" runat="server" DefaultButton="btnRegister">
            <table>
                <tr>
                    <td>
                        Membership of Upload Image Supplies is free.
                        <br />
                    </td>
                </tr>
                <tr>
                    <td class="clsRegisterTitle">
                        Account Information
                    </td>
                </tr>
                <tr>
                    <td style="padding: 5px 7px 5px 15px; text-align: left;">
                        <table border="0" cellpadding="0" cellspacing="3">
                            <tr>
                                <td align="right">
                                    User Name:
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtusername" runat="server" CssClass="txtRegisterReq" Width="250px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="*"
                                        ControlToValidate="txtusername" ValidationGroup="grpRegister"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    Email:
                                </td>
                                <td align="left">
                                    <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="txtEmail"
                                        WatermarkText="email@user.com">
                                    </asp:TextBoxWatermarkExtender>
                                    <asp:TextBox ID="txtEmail" runat="server" ValidationGroup="validRegister" ToolTip="Input email"
                                        CssClass="txtRegisterReq" Width="250px"></asp:TextBox>
                                    &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtEmail"
                                        runat="server" ErrorMessage="*" SetFocusOnError="True" Display="Static" ValidationGroup="grpRegister"></asp:RequiredFieldValidator>&nbsp;
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="Invalid email address"
                                        Display="Static" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                        ControlToValidate="txtEmail" SetFocusOnError="True" ValidationGroup="grpRegister"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    Password:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" ToolTip="Input password"
                                        CssClass="txtRegisterReq" Width="250px"></asp:TextBox>
                                    &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtPassword"
                                        runat="server" ErrorMessage="*" Display="Static" ValidationGroup="grpRegister"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    Confirm Password:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtRePassword" runat="server" TextMode="Password" ToolTip="Retype your password"
                                        CssClass="txtRegisterReq" Width="250px"></asp:TextBox>
                                    &nbsp;<asp:RequiredFieldValidator ID="requireRePassword" ControlToValidate="txtRePassword"
                                        runat="server" ErrorMessage="*" Display="Dynamic" ValidationGroup="grpRegister"></asp:RequiredFieldValidator><asp:CompareValidator
                                            ID="CompareValidator1" runat="server" ErrorMessage="Passwords do not match. "
                                            Display="Dynamic" ControlToCompare="txtPassword" ControlToValidate="txtRePassword"
                                            ValidationGroup="grpRegister"></asp:CompareValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    First Name:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtFName" runat="server" ValidationGroup="validRegister" CssClass="txtRegisterReq"
                                        Width="250px"></asp:TextBox>
                                    &nbsp;<asp:RequiredFieldValidator ID="requireFirstName" ControlToValidate="txtFName"
                                        runat="server" ErrorMessage="*" Display="Dynamic" ValidationGroup="grpRegister"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" style="width: 230px;">
                                    Last Name:
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtLName" runat="server" ValidationGroup="validRegister" CssClass="txtRegisterReq"
                                        Width="250px"></asp:TextBox>
                                    &nbsp;<asp:RequiredFieldValidator ID="requireLastName" ControlToValidate="txtLName"
                                        runat="server" ErrorMessage="*" Display="Dynamic" ValidationGroup="grpRegister"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    Phone Number :
                                </td>
                                <td>
                                    <asp:TextBox ID="txtPhone" runat="server" CssClass="txtRegisterReq" Width="250px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="txtPhone"
                                        runat="server" ErrorMessage="*" Display="Dynamic" ValidationGroup="grpRegister"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    Country :
                                </td>
                                <td>
                                    <%--<asp:TextBox ID="drcountry" runat="server" CssClass="txtRegisterReq" Width="250px"></asp:TextBox>--%>
                                    <asp:DropDownList ID="drcountry" runat="server" CssClass="txtRegisterReq" Width="252px">
                                        <%--<asp:ListItem Value="AF">Afghanistan</asp:ListItem>
                                        <asp:ListItem Value="AL">Albania</asp:ListItem>
                                        <asp:ListItem Value="DZ">Algeria</asp:ListItem>
                                        <asp:ListItem Value="AS">American Samoa</asp:ListItem>
                                        <asp:ListItem Value="AD">Andorra</asp:ListItem>
                                        <asp:ListItem Value="AO">Angola</asp:ListItem>
                                        <asp:ListItem Value="AI">Anguilla</asp:ListItem>
                                        <asp:ListItem Value="AQ">Antarctica</asp:ListItem>
                                        <asp:ListItem Value="AG">Antigua And Barbuda</asp:ListItem>--%>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" ControlToValidate="drcountry"
                                        runat="server" ErrorMessage="*" Display="Dynamic" ValidationGroup="grpRegister"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="clsRegisterTitle">
                        <span id="result_box"><span style="color: White"> Verification</span></span>
                    </td>
                </tr>
                <tr>
                    <td align="center">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td>
                                    <asp:UpdatePanel ID="updCap" runat="server">
                                        <ContentTemplate>
                                            <cc1:CaptchaControl ID="msCaptcha" runat="server" BorderWidth="1px" BorderStyle="Solid"
                                                BorderColor="#5daeff" Width="185" FontColor="#007eb3" ForeColor="AliceBlue" NoiseColor="#237ceb"
                                                CaptchaBackgroundNoise="Extreme" CaptchaLength="5" CaptchaHeight="50" CaptchaWidth="185"
                                                CaptchaLineNoise="None" CaptchaMinTimeout="5" CaptchaMaxTimeout="240" LineColor="Yellow"
                                                CaptchaFontWarping="Low" />
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </td>
                                <td valign="top" style="padding-left: 5px;">
                                    <asp:Label ID="lblInputCaptcha" runat="server" Text=" Verification code:" Style="font-size: 12px;"></asp:Label>
                                    <asp:UpdatePanel ID="updTxt" runat="server">
                                        <ContentTemplate>
                                            <asp:TextBox ID="txtCaptcha" runat="server" Width="100" CssClass="txtRegisterReq"
                                                autocomplete="off" ToolTip=" Verification code"></asp:TextBox>&nbsp;<asp:RequiredFieldValidator
                                                    ID="regCaptcha" runat="server" ErrorMessage="" ToolTip="Input Captcha." ForeColor="Red"
                                                    ControlToValidate="txtCaptcha" SetFocusOnError="true" Text="*" ValidationGroup="grpRegister"></asp:RequiredFieldValidator></ContentTemplate>
                                        <Triggers>
                                            <asp:AsyncPostBackTrigger ControlID="lnkRefreshCaptcha" EventName="Click" />
                                        </Triggers>
                                    </asp:UpdatePanel>
                                    <asp:LinkButton ID="lnkRefreshCaptcha" runat="server" Text="Reload Verification code"
                                        CausesValidation="false" Style="font-size: 12px;" OnClick="lnkRefreshCaptcha_Click"></asp:LinkButton>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="clsRegisterTitle">
                        Agreement
                    </td>
                </tr>
                <tr>
                    <td style="padding: 5px 7px 5px 7px; text-align: left;">
                        <table border="0" cellpadding="0" cellspacing="3" width="100%">
                            <tr>
                                <td id="tdCheckboxAgree" class="loginLnk">
                                    <asp:CheckBox ID="chkAccept" runat="server" />
                                    I accept Upload Image
                                    <asp:HyperLink ID="lnkPolicy" runat="server" NavigateUrl="">privacy policy</asp:HyperLink>
                                    <asp:CustomValidator ClientValidationFunction="ValidateChecked" runat="server" ID="valchkAccept"
                                        ValidationGroup="grpRegister" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="center" style="padding-top: 7px;">
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                                <asp:Button ID="btnRegister" runat="server" CssClass="button" Text="Sign Up" ValidationGroup="grpRegister"
                                    OnClick="btnRegister_Click" />
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="btnRegister" EventName="Click" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td align="center" style="padding-top: 5px;">
                        <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                            <ProgressTemplate>
                                <asp:Image ID="imgLoading" runat="server" ToolTip="Loading..." ImageUrl="~/en/images/loadingAnimation.gif"
                                    Style="border-width: 0px;" Width="31px" />
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </ContentTemplate>
</asp:UpdatePanel>
